

<%@ page import="com.auctionhaus.Listing; com.auctionhaus.Customer; com.auctionhaus.Bid" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'bid.label', default: 'Bid')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
    <div class="body">
            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${bidInstance}">
            <div class="errors">
                <g:renderErrors bean="${bidInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" >
                <div class="dialog">
                    <table>
                        <tbody>
                            <div align="right">
                              <label>Listing:</label>
                              <g:select name="selectedListName" from="${new Listing().getCurrentListings()}"
                                                 value="${bidInstance?.listing?.listName}"
                                                 optionKey="listName" optionValue="listName" />
                            </div>
                            <div class="formField" align="right">
                              <label for="amount">Bid Amount:</label>
                              <g:textField name="amount" value="${bidInstance?.amount}" />
                            </div>
                            <div class="formField" align="right">
                                <label for="buyerEmailAddress">Buyer Email Address:</label>
                                <g:textField name="buyerEmailAddress" value="${bidInstance?.buyer?.emailAddress}"/>
                            </div>
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
